This application is based on and incorporates herein by reference Japanese Patent Application No. 2000-402415 filed on Dec. 28, 2000.
1. Field of the Invention
The present invention relates to a programming technique for a self-diagnostic function in a controller for controlling a vehicle.
2. Description of Related Art
In general, the rapid progress of computer techniques in recent years has brought about the introduction of computer systems in every aspect of a vehicle, such as an automobile.
Particularly, a computer system for controlling a vehicle to assure higher reliability has been improved by including a self-diagnostic or self-diagnosis function. It is now possible for a vehicle to execute a diagnostic process for automatically checking operating conditions of a computer unit and its sensors or the like. This is done in an adequate time period by lighting a warning lamp (MIL), when a fault occurs therein. This notifies the occurrence of the fault to the user and/or stores the fault code (DTC), which allows a maintenance person to identify the nature of the fault. This diagnostic process aides about 200 items currently covering the sensors, such as: a crank angle sensor, a cam angle sensor, a water temperature sensor, or the like. The object of this diagnostic process is called the xe2x80x9cdiagnosis objectxe2x80x9d or xe2x80x9cdiagnostic object.xe2x80x9d
In the design stage of the self-diagnostic program, to realize this diagnostic process, it must be realized that the diagnostic object is changed depending on car models, a grade of a car, and/or timing of model changes. Therefore, the fault detection logic is generally described for each diagnostic object in the self-diagnostic program. Therefore, if the diagnostic object is changed, depending upon the change, the change may be covered by changing only the corresponding fault detection logic.
Programming focused on a xe2x80x9cthingxe2x80x9d such as a diagnostic object is well known as xe2x80x9cobject-oriented programming.xe2x80x9d A change in units of an object can be realized for a change of the diagnostic object. The object which does not require any change can be reused by structuring the object in units of fault detection logic.
In this specification, the expression an/the xe2x80x9cobject executes . . . xe2x80x9d in which the term xe2x80x9cobjectxe2x80x9d is the subject of a sentence is often used but it means that an operation of the object is executed when a CPU provided in the vehicle controller executes the program installed in the object.
The fault detection logic explained above is usually repeatedly executed by predetermined timing, in which timing a plurality of fault detection logics should be executed. This has been described in a platform (hereinafter, referred to as xe2x80x9cPFxe2x80x9d) as a program of a lower hierarchy.
Meanwhile, when the diagnostic object is changed, the execution timing of the fault detection logic may also be changed in some cases. Therefore, a program structure which provides an independent scheduler program (scheduler) for discriminating the execution timing from the PF has also been proposed. Therefore, there is merit that the change in execution timing can be covered easily by changing the scheduler.
However, for execution of a part of the fault detection logic, the timing and predetermined conditions must be considered. Namely, even when the execution timing is discriminated, situations exist in which executions should not occur. This is because of the condition that the fault detection logics are related to each other.
In some cases, the corresponding fault detection logic and a relationship with the correction of the fault detection logic are required for a change in the diagnostic object or the change in the execution timing. This correction will be explained below.
For example, when the first sensor is deemed defective, a fault of a second sensor in relation to the first sensor cannot be determined in some cases. In particular, an air-flow sensor for measuring the amount of intake air in the engine can be diagnosed accurately only when the intake air temperature sensor for detecting the intake air temperature is diagnosed as normal.
Moreover, a detected value of the first sensor is used for a diagnostic process of the second sensor in some cases. In particular, for the diagnostic process of the intake air temperature sensor explained above, or for detection value of a throttle sensor for detecting an opening of a throttle valve that is driven by an accelerator pedal.
As explained above, an execution condition for insuring the fault diagnosis result of the diagnostic object exists in some cases, and this execution condition is determined by the fault detection logic. The determination logic of the execution condition depends on other fault detection logic.
In this program structure, when fault detection logic corresponding to a certain diagnostic object is changed, it has been requested to review all fault detection logic relating to the above fault detection logic. In the example explained above, if fault detection logic of a throttle sensor is changed, the fault detection logic of the intake air temperature sensor and the fault detection logic of the air-flow sensor in relation to the intake air temperature sensor, have to be changed as required or as necessary.
Therefore, an extraordinary long time has been required in some cases to change the self-diagnostic program and it has lowered the re-utilization property. Moreover, if the change becomes large in scale, a possibility for generating a discrepancy in the program also becomes large and therefore the quality of the self-diagnostic program may be lowered.
The present invention has been proposed to overcome the problems explained above. It is therefore an object of the present invention to provide the controller for a vehicle having the self-diagnostic function with the ability to execute the fault detection of the diagnostic object with appropriate timing. Another objective is to assure change of the self-diagnostic program to realize the self-diagnostic function which contributes to quality improvement of the self-diagnostic program. This is so even if it is required to correct the execution condition of the fault detection due to a change in the diagnostic object.
In order to achieve objects of the invention, a controller for a vehicle is provided with the self-diagnostic function for automatically detecting a fault of the diagnostic object.
The fact that the self-diagnostic program is to realize this self-diagnostic function is based on the precondition that the fault detection logic, to detect a fault of the diagnostic object, is described through division thereof in a unit related to the diagnostic object. The unit of the diagnostic object is determined for each diagnostic object or for each fault detection process. The diagnostic object corresponds to the fault detection process almost on a one to one basis, but the diagnostic object of a common fault detection process can also exist. Therefore, it is preferable to provide the detection logic for every fault detection process from a point of view of providing a compact self-diagnostic program.
Under the pre-condition explained above, the determination logic of the execution condition when executing the fault detection logic based on an external timing signal is described simultaneously, but separately from the fault detection logic. For example, the determination logic of the execution condition is described as an exclusive program.
The self-diagnostic program is an object-oriented design and is structured in units of objects allowing reuse with inclusion of the fault detection object for detecting; a fault of the diagnostic object, a scheduler object, and a drive determination object. The fault detection object is prepared for every unit in relation to the diagnostic object.
In this case, the scheduler object determines the fault detection object as a drive object based on the external timing signal. Therefore, the drive determination object determines whether the fault detection object, as a drive object, determined by the scheduler object, should be driven or not. It also provides drive permission to the scheduler object based on the result of determination.
When this drive permission is issued, the scheduler object sends a drive instruction to the fault detection object. Namely, the determination object of the execution condition is executed by the drive determination object separate from the fault detection object. Therefore, if it is required to correct the execution condition due to the change of the diagnostic object, this requirement can be covered by adding a change to the corresponding fault detection object and drive determination object. It is no longer required to correct a fault detection object that is not directly related to the changed diagnostic object. As a result, the self-diagnostic program can be changed easily. Moreover, since the changes are summarized, a human mistake can be reduced, thereby providing contribution to improvement in the quality of the self-diagnostic program.
The drive determination object is thought to determine whether the fault detection object of the drive object should be driven or not, in consideration of the relation with the fault detection among the fault detection objects. The relationship with fault detection as explained here, is considered, for example, as a case where a fault of the second sensor in relation to the first sensor cannot be determined accurately. This occurs when the first sensor is determined as defective as explained above, and a detected value of the first sensor is used for the diagnostic process of the second sensor. More particularly, the determination in consideration of the relationship with the fault detection is thought to be made depending on at least one of the fault detection results or a fault detection execution record of the other fault detection object in relation to the fault detection object as a drive object.
Since electric power is usually supplied to sensors or the like from an on-board battery, if the battery is temporarily. removed, generation of fault is determined, even if the sensor itself does not generate a fault, because the detected value obtained from a sensor is no longer within a normal range. Therefore, when battery voltage is not in a predetermined range, the diagnostic process is generally stopped or the result of diagnosis is invalidated after the diagnostic process. Therefore, it is important that the battery voltage is normal for several fault detection processes.
Continuing, the drive determination object may determine whether the fault detection object of the drive object should be driven or not in consideration of the pre-condition of the fault detection. Here, it is enough of a pre-condition that the condition is used in common at least among a part of the fault detection objects. In particular, determination of the pre-condition is thought to be made based on at least one of the voltages of the on-board battery and an elapsed time after starting the engine of the vehicle. When there is a sensor in which a detected value is not in the normal range immediately after starting the engine, a determination is made based on the passage of time after starting the engine.
Accordingly, the pre-condition for execution of the diagnostic function is summarized for the description and it can change easily. Moreover, when thinking that the pre-condition is used in common for a plurality of the fault detection logics, this pre-condition contributes to improvement in the quality of the self-diagnostic program in such a manner that the self-diagnostic program can be compactly designed.
The scheduler object determines the fault detection object of the drive object based on the external timing signal. Therefore, when the execution timing is changed, it can be covered by changing the scheduler object. Namely, in the present invention, the execution timing and execution condition are different and these are individually determined. Accordingly, the scheduler object and drive determination object are provided separately.
In order to facilitate a change of the scheduler object, it is preferable that the scheduler object have a correspondence table describing the fault detection object of the drive object which corresponds to the external timing signal. The fault detection object as a drive object is determined by referring to the correspondence table. In some cases, a plurality of fault detections are conducted in a certain timing, for example, in a manner that a water temperature sensor diagnosis, an air-flow sensor diagnosis and an intake air temperature sensor diagnosis are executed, every sixty-four (64) ms. Therefore, when a relationship between the timing signal and fault detection object as a drive object is summarized in a table, the relationship is easily understood. The execution timing is easily changed and much contribution is made, resulting in improvement of the quality of the self-diagnostic program.
Here, the self-diagnostic program installed in the controller for a vehicle explained above is recorded, for example, in a computer-readable recording medium such as an FD, an MO, a DVD, a CD-ROM, a hard disc, or the like. It can be driven as required by loading it into the computer system. Moreover, it is also possible to pre-record the program into a ROM and a backup RAM as a computer-readable recording medium, and then load the ROM or backup RAM into the computer system for use.
Further areas of applicability of the present invention will become apparent from the detailed description provided hereinafter. It should be understood that the detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.